var t = getApp();

Page({
    data: {
        payShow: !1,
        allUserShow: !1,
        infoData: [],
        allUserShowList: [],
        allUserpage: 1,
        payPrice: [],
        diyPayprice: "",
        priceIndex: null,
        posterShow: !1,
        poster_Data: {
            poster_data: null,
            background: {}
        },
        poster_id: null,
        iPnoneBottomBol: !1,
        showcarrfootBol: !0,
        isNewPosterPlugin: !1
    },
    onLoad: function(a) {
        if (this.data.options = a, a.scene) {
            var i = decodeURIComponent(a.scene);
            console.log(i, "dddddd");
            var o = [];
            o = i.split(",");
            for (var e = 0; e < o.length; e++) {
                var n;
                "id" == (n = o[e].split("="))[0] && (this.data.options.id = n[1]), "mid" == n[0] && t._setMid(n[1]);
            }
        }
        this.init(), this.getData(), this.getiPnoneBottom();
    },
    toActiveGood: function() {
        wx.navigateTo({
            url: "/packageF/crowd_activity/goods/goods?id=" + this.data.infoData.activity_id
        });
    },
    getiPnoneBottom: function() {
        try {
            wx.getStorageSync("iPhoneBottom") && this.setData({
                iPnoneBottomBol: !0
            });
        } catch (t) {}
    },
    init: function() {
        this.setData({
            posterShow: !1,
            payShow: !1,
            allUserShow: !1
        });
    },
    getData: function() {
        var a = this, i = t.getNetAddresss("plugin.crowdfunding.frontend.activity-member.show");
        t._getNetWork({
            url: i,
            data: {
                activity_member_id: this.data.options.id
            },
            success: function(i) {
                var o = i.data;
                1 == o.result ? (a.setData({
                    infoData: o.data
                }), wx.setNavigationBarTitle({
                    title: a.data.infoData.belongs_to_activity.title ? "".concat(a.data.infoData.current_activity_member.nickname, "的").concat(a.data.infoData.belongs_to_activity.title) : "众筹活动"
                })) : t.tips(o.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    toActive: function() {
        wx.navigateTo({
            url: "/packageF/crowd_activity/goods/goods?id=" + this.data.infoData.activity_id
        });
    },
    allUserComfirm: function() {
        var a = this, i = "";
        i = 0 == this.data.priceIndex || this.data.priceIndex ? this.data.payPrice[this.data.priceIndex] : this.data.diyPayprice;
        var o = t.getNetAddresss("plugin.crowdfunding.frontend.pre-activity-order.crowdfunding");
        t._getNetWork({
            url: o,
            data: {
                activity_member_id: this.data.infoData.id,
                amount: i
            },
            success: function(i) {
                var o = i.data;
                if (1 == o.result) {
                    var e = o.data.order_sn;
                    a.setData({
                        payShow: !1
                    }), wx.navigateTo({
                        url: "/packageF/crowd_activity/crowd_activity_OrderPay/crowd_activity_OrderPay?sn=" + e
                    });
                } else a.setData({
                    payShow: !1
                }), t.tips(o.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    tapPriceSelect: function(t) {
        var a = t.currentTarget.dataset.index, i = t.currentTarget.dataset.item;
        this.setData({
            PaypriceOnece: i,
            priceIndex: a
        });
    },
    tapPayShowInp: function(t) {
        var a = t.detail.value;
        this.setData({
            diyPayprice: a,
            priceIndex: null
        });
    },
    payShowTap: function() {
        var a = this;
        this.setData({
            payShow: !0,
            payPrice: [],
            diyPayprice: "",
            priceIndex: null
        });
        var i = t.getNetAddresss("plugin.crowdfunding.frontend.activity.fixedAmount");
        t._getNetWork({
            url: i,
            success: function(i) {
                var o = i.data;
                1 == o.result ? (a.setData({
                    payPrice: o.data
                }), o.data.length > 0 && a.setData({
                    priceIndex: 0
                })) : t.tips(o.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    posterShowTap: function() {
        this.setData({
            posterShow: !0
        });
    },
    allUserShowTap: function() {
        this.setData({
            allUserShow: !0
        });
    },
    allUserShowCancel: function() {
        this.setData({
            allUserShow: !1
        });
    },
    cancelPayShow: function() {
        this.setData({
            payShow: !1
        });
    },
    tapPayShow: function() {
        this.setData({
            payShow: !0
        });
    },
    confirmPayShow: function() {},
    tapPosterShow: function() {
        this.setData({
            posterShow: !1
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});